/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Inter", sans-serif;
  background: #f9fafb;
  color: #111827;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.container {
  text-align: center;
}
.title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

/* Hide checkbox */
.flip-checkbox {
  display: none;
}

/* Button */
.flip-btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
  margin-bottom: 2rem;
}
.flip-btn:hover {
  background: #1e40af;
}

/* Coin container */
.coin {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  position: relative;
  perspective: 1000px;
}

.face {
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  color: #fff;
}

.front {
  background: #10b981; /* green heads */
}
.back {
  background: #ef4444; /* red tails */
  transform: rotateY(180deg);
}

/* Animation when flipped */
.flip-checkbox:checked ~ .coin {
  animation: flip 1s ease forwards;
}

@keyframes flip {
  0% {
    transform: rotateY(0);
  }
  100% {
    transform: rotateY(1800deg);
  } /* 5 full spins */
}

/* Footer */
.credit {
  margin-top: 1rem;
}
.credit a {
  text-decoration: none;
  color: #111827;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.credit a:hover {
  color: #2563eb;
}
.github-icon {
  fill: currentColor;
}
